<SCRIPT type="text/javascript">
 var digitArray = new Array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f');

function toHex( n ) 
{
	var result = ''
	var start = true;

	for ( var i=32; i>0; ) 
	{
		i -= 4;
		var digit = ( n >> i ) & 0xf;

		if (!start || digit != 0) 
		{
			start = false;
			result += digitArray[digit];
		}
	}

	return ( result == '' ? '0' : result );
}

$(document).ready(function(){
	var DevicePath,ret,n,mylen;
	try
	{
	
		if($.browser.msie)
		{
			//建立操作我们的锁的控件对象，用于操作我们的锁
			var aObject = new ActiveXObject("Syunew6A.s_simnew6");
			
			//查找是否存在锁,这里使用了FindPort函数
			DevicePath = aObject.FindPort(0);

			//读取锁的唯一ID
			frmlogin.KeyID.value=toHex(aObject.GetID_1(DevicePath))+toHex(aObject.GetID_2(DevicePath));
			if( aObject.LastError!= 0 )
			{
				window.alert( "Err to GetID,ErrCode is:"+aObject.LastError.toString());
				return ;
			}
			
			//获取设置在锁中的用户名，使用默认的读密码"FFFFFFFF","FFFFFFFF
			ret=aObject.YRead(0,1,"D3E08431","76D4BDC0",DevicePath);
			mylen =aObject.GetBuf(0);
			frmlogin.username.value=aObject.YReadString(1,mylen, "D3E08431", "76D4BDC0", DevicePath);
			if( aObject.LastError!= 0 )
			{
				window.alert(  "Err to GetUserName,ErrCode is:"+aObject.LastError.toString());
				return ;
			}

			//获到设置在锁中的用户密码,,使用默认的读密码"FFFFFFFF","FFFFFFFF"
			ret=aObject.YRead(20,1,"D3E08431","76D4BDC0",DevicePath);
			mylen =aObject.GetBuf(0);
			frmlogin.password.value=aObject.YReadString(21,mylen,"D3E08431", "76D4BDC0", DevicePath);
			if( aObject.LastError!= 0 )
			{
				window.alert( "Err to GetPwd,ErrCode is:"+aObject.LastError.toString());
				return ;
			}

			//这里返回对随机数的HASH结果
			frmlogin.return_EncData.value=aObject.EncString(frmlogin.rnd.value,DevicePath);
			if( aObject.LastError!= 0 )
			{
					window.alert( "Err to StrEnc,ErrCode is:"+aObject.LastError.toString());
					return ;
			}
		}
	}
	catch (e) 
	{
		alert(e.name + ": " + e.message);
	}
});
</SCRIPT>


<script type="text/javascript">
$(document).ready(function(){
	function a()
	{
		document.getElementById("ext-comp-1006").className="x-btn x-btn-noicon x-btn-over";
	}
	function b()
	{
		document.getElementById("ext-comp-1007").className="x-btn x-btn-noicon x-btn-over";
	}
	function c()
	{
		document.getElementById("ext-comp-1006").className="x-btn x-btn-noicon";
	}
	function d()
	{
		document.getElementById("ext-comp-1007").className="x-btn x-btn-noicon";
	}

	$("#a").mouseover(a);
	$("#b").mouseover(b);
	$("#a").mouseout(c);
	$("#b").mouseout(d);
	JSFX_FloatTopDiv_a();
	JSFX_FloatTopDiv_b();
	document.getElementById("ext-comp-1002").onkeydown=function(B)
	{
		var A;
		if(!B)
		{
			B=window.event;
		}
		if(document.all)
		{
			A=B.keyCode;
		}
		else 
		{
			A=B.which;
		}
		if(A==13)
		{
			document.getElementById("ext-gen3").onsubmit();
		}
	};
});

function JSFX_FloatTopDiv_a(){
	var d=document;
	var startX=(d.documentElement.clientWidth-d.body.scrollLeft)/2-127;
	var startY=(d.documentElement.clientHeight-d.body.scrollTop)/2-75;
	function ml(id){
		var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
		if(d.layers){
			el.style=el;
		}
		el.sP=function(x,y){
			this.style.left=x+"px";
			this.style.top=y+"px";
		};
		el.x=startX;
		el.y=startY;
		return el;
	}
	window.stayTopLeft_a=function(){
		startX=(d.documentElement.clientWidth-d.body.scrollLeft)/2-127;
		startY=(d.documentElement.clientHeight-d.body.scrollTop)/2-75;
		ftlObj_a.sP(startX,startY);
		setTimeout("stayTopLeft_a()",10);
	};
	ftlObj_a=ml("ext-gen48");
	stayTopLeft_a();
}
function JSFX_FloatTopDiv_b(){
	var d=document;
	var startX=(d.documentElement.clientWidth-d.body.scrollLeft)/2-125;
	var startY=(d.documentElement.clientHeight-d.body.scrollTop)/2-75;
	function ml(id){
		var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
		if(d.layers){
			el.style=el;
		}
		el.sP=function(x,y){
			this.style.left=x+"px";
			this.style.top=y+"px";
		};
		el.x=startX;
		el.y=startY;
		return el;
	}
	window.stayTopLeft_b=function(){
		startX=(d.documentElement.clientWidth-d.body.scrollLeft)/2-125;
		startY=(d.documentElement.clientHeight-d.body.scrollTop)/2-75;
		ftlObj_b.sP(startX,startY);
		setTimeout("stayTopLeft_b()",10);
	};
	ftlObj_b=ml("loginWin");
	stayTopLeft_b();
}

function loginAjaxDone(json){
	DWZ.ajaxDone(json);
	var error = json.error;
	var msg = json.msg;
	if(error==1){
		alertMsg.error(msg);
	}else {
		if(error==0){
			alertMsg.correct(msg);
			window.location.href="<?php echo Yii::app()->params['admin_domain']?>/site/index";
		}else {
			alertMsg.error("\u767b\u5f55\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\uff01");
		}
	}
	return false;
}
</script>
<style type="text/css">
.yzm img
{
	margin-bottom:-10px;
}

.yzm input
{
	_margin-top:-20px;
}
</style>
</head>
<body scroll="no">
<div class="x-shadow" id="ext-gen48" style="z-index: 2; left: 591px; top: 297px; width: 258px; height: 183px; display: block;">
  <div class="xst">
    <div class="xstl"></div>
    <div class="xstc" style="width: 246px;"></div>
    <div class="xstr"></div>
  </div>
  <div class="xsc" style="height: 138px;">
    <div class="xsml"></div>
    <div class="xsmc" style="width: 246px;"></div>
    <div class="xsmr"></div>
  </div>
  <div class="xsb">
    <div class="xsbl"></div>
    <div class="xsbc" style="width: 246px;"></div>
    <div class="xsbr"></div>
  </div>
</div>
<div id="loginWin" class=" x-window" style="position: absolute; z-index: 3; visibility: visible; left: 595px; top: 294px; width: 250px; display: block;">
  <div class="x-window-tl">
    <div class="x-window-tr">
      <div class="x-window-tc">
        <div class="x-window-header x-unselectable x-window-draggable" id="ext-gen14" style="-moz-user-select: none;"><span class="x-window-header-text"></span></div>
      </div>
    </div>
  </div>
  <div class="x-window-bwrap" id="ext-gen15">
    <div class="x-window-ml">
      <div class="x-window-mr">
        <div class="x-window-mc" id="ext-gen19">
          <div class="x-window-body x-column-layout-ct" id="ext-gen16" style="width: 236px; ">
            <div class="x-column-inner" id="ext-gen29" style="width: 236px;">
              <div id="ext-comp-1003" class=" x-panel x-panel-noborder x-column" style="width: 236px;">
                <div class="x-panel-bwrap" id="ext-gen31">
                  <div class="x-panel-body x-panel-body-noheader x-panel-body-noborder" id="ext-gen32" style="width: 236px;">
                    <div id="loginLogo" class=" x-panel">
                      <div class="x-panel-tl">
                        <div class="x-panel-tr">
                          <div class="x-panel-tc"></div>
                        </div>
                      </div>
                      <div class="x-panel-bwrap" id="ext-gen35">
                        <div class="x-panel-ml">
                          <div class="x-panel-mr">
                            <div class="x-panel-mc" id="ext-gen38">
                              <div class="x-panel-body" id="ext-gen36" style="padding-top: 4px; height: 18px;">
                                <h3><center>后台管理系统</center></h3>
                              </div>
                            </div>
                          </div>
                        </div>
                        <div class="x-panel-bl x-panel-nofooter" id="ext-gen37">
                          <div class="x-panel-br">
                            <div class="x-panel-bc"></div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div id="ext-comp-1004" class=" x-panel x-panel-noborder x-column" style="width: 236px;">
                <div class="x-panel-bwrap" id="ext-gen33">
                  <div class="x-panel-body x-panel-body-noheader x-panel-body-noborder" id="ext-gen34" style="width: 236px;">
                    <div id="loginForm" class=" x-panel x-form-label-right">
                      <div class="x-panel-tl">
                        <div class="x-panel-tr">
                          <div class="x-panel-tc"></div>
                        </div>
                      </div>
                      <div class="x-panel-bwrap" id="ext-gen40">
                        <div class="x-panel-ml">
                          <div class="x-panel-mr">
                            <div class="x-panel-mc" id="ext-gen42">
                            <form action="<?php echo Yii::app()->params['admin_domain']?>/site/login" id="ext-gen3" name="frmlogin" method="POST" class="x-panel-body x-form required-validate" onsubmit="return validateCallback(this, loginAjaxDone);">
                                <div tabindex="-1" class="x-form-item " id="ext-gen44">
                                  <label class="x-form-item-label" style="width: 30px;" for="ext-comp-1001" id="ext-gen45">账号:</label>
                                  <div style="padding-left: 35px;" id="x-form-el-ext-comp-1001" class="x-form-element">
                                    <input type="text" name="username" id="ext-comp-1001" autocomplete="off" size="25" class=" x-form-text x-form-field required" style="width: 176px;height:18px;" >
                                  </div>
                                  <div class="x-form-clear-left"></div>
                                </div>
                                <div tabindex="-1" class="x-form-item " id="ext-gen46">
                                  <label class="x-form-item-label" style="width: 30px;" for="ext-comp-1002" id="ext-gen47">密码:</label>
                                  <div style="padding-left: 35px;" id="x-form-el-ext-comp-1002" class="x-form-element">
                                    <input type="password" name="password" id="ext-comp-1002" autocomplete="off" size="25" class=" x-form-text x-form-field required" style="width: 176px;height:18px;">
                                  </div>
                                  <div class="x-form-clear-left"></div>
                                </div>
                                <div tabindex="-1" class="x-form-item " id="ext-gen46">
                                  <label class="x-form-item-label" style="width: 30px;" for="ext-comp-1002" id="ext-gen47">验证: </label>
                                  <div style="padding-left: 35px;" id="x-form-el-ext-comp-1002" class="x-form-element yzm">
                                    <input type="text" name="verifyCode" id="ext-comp-1002" autocomplete="off" size="25" class=" x-form-text x-form-field required" style="width: 88px;height:18px;"><img src="/site/seccode" onclick="this.src='/site/seccode?'+Math.random();" />
                                  </div>
                                  <div class="x-form-clear-left"></div>
                                </div>
                              </form>
                            </div>
                          </div>
                        </div>
                        <div class="x-panel-bl x-panel-nofooter" id="ext-gen41">
                          <div class="x-panel-br">
                            <div class="x-panel-bc"></div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="x-clear" id="ext-gen30"></div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="x-window-bl" id="ext-gen18">
      <div class="x-window-br">
        <div class="x-window-bc">
          <div class="x-window-footer x-panel-btns" id="ext-gen17" style="width: 226px;">
            <div class="x-panel-fbar x-small-editor x-toolbar-layout-ct" id="ext-comp-1005" style="width: auto;">
              <table cellspacing="0" class="x-toolbar-ct">
                <tbody>
                  <tr>
                    <td align="center" class="x-toolbar-left"><table cellspacing="0" style="margin-left:40px;*margin-left:10px;">
                        <tbody>
                          <tr class="x-toolbar-left-row">
                            <td class="x-toolbar-cell" id="ext-gen24"><table cellspacing="0" class="x-btn x-btn-noicon" id="ext-comp-1006" style="width: 75px;">
                                <tbody class="x-btn-small x-btn-icon-small-left">
                                  <tr>
                                    <td class="x-btn-tl"><i>&nbsp;</i></td>
                                    <td class="x-btn-tc"></td>
                                    <td class="x-btn-tr"><i>&nbsp;</i></td>
                                  </tr>
                                  <tr>
                                    <td class="x-btn-ml"><i>&nbsp;</i></td>
                                    <td class="x-btn-mc" id="a"><em unselectable="on" class="">
                                      <button type="button" onclick="return document.getElementById('ext-gen3').onsubmit()" id="ext-gen25" class=" x-btn-text">登录</button>
                                      </em></td>
                                    <td class="x-btn-mr"><i>&nbsp;</i></td>
                                  </tr>
                                  <tr>
                                    <td class="x-btn-bl"><i>&nbsp;</i></td>
                                    <td class="x-btn-bc"></td>
                                    <td class="x-btn-br"><i>&nbsp;</i></td>
                                  </tr>
                                </tbody>
                              </table></td>
                            <td class="x-toolbar-cell" id="ext-gen26"><table cellspacing="0" class="x-btn x-btn-noicon" id="ext-comp-1007" style="width: 75px;">
                                <tbody class="x-btn-small x-btn-icon-small-left">
                                  <tr>
                                    <td class="x-btn-tl"><i>&nbsp;</i></td>
                                    <td class="x-btn-tc"></td>
                                    <td class="x-btn-tr"><i>&nbsp;</i></td>
                                  </tr>
                                  <tr>
                                    <td class="x-btn-ml"><i>&nbsp;</i></td>
                                    <td class="x-btn-mc" id="b"><em unselectable="on" class="">
                                      <button type="button" id="ext-gen27" class=" x-btn-text" onclick="$('form').resetForm();">重填</button>
                                      </em></td>
                                    <td class="x-btn-mr"><i>&nbsp;</i></td>
                                  </tr>
                                  <tr>
                                    <td class="x-btn-bl"><i>&nbsp;</i></td>
                                    <td class="x-btn-bc"></td>
                                    <td class="x-btn-br"><i>&nbsp;</i></td>
                                  </tr>
                                </tbody>
                              </table></td>
                          </tr>
                        </tbody>
                      </table></td>
                    <td align="right" class="x-toolbar-right"><table cellspacing="0" class="x-toolbar-right-ct">
                        <tbody>
                          <tr>
                            <td><table cellspacing="0">
                                <tbody>
                                  <tr class="x-toolbar-right-row"></tr>
                                </tbody>
                              </table></td>
                            <td><table cellspacing="0">
                                <tbody>
                                  <tr class="x-toolbar-extras-row"></tr>
                                </tbody>
                              </table></td>
                          </tr>
                        </tbody>
                      </table></td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="x-clear" id="ext-gen21"></div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <a tabindex="-1" class="x-dlg-focus" href="#" id="ext-gen22">&nbsp;</a></div>
<div id="footer">Copyright &copy; 2009-<?php echo date('Y', time());?> www.05wan.com</div>
<!--拖动效果-->
<div class="resizable"></div>
<!--阴影-->
<div class="shadow" style="width:508px; top:148px; left:296px;">
  <div class="shadow_h">
    <div class="shadow_h_l"></div>
    <div class="shadow_h_r"></div>
    <div class="shadow_h_c"></div>
  </div>
  <div class="shadow_c">
    <div class="shadow_c_l" style="height:296px;"></div>
    <div class="shadow_c_r" style="height:296px;"></div>
    <div class="shadow_c_c" style="height:296px;"></div>
  </div>
  <div class="shadow_f">
    <div class="shadow_f_l"></div>
    <div class="shadow_f_r"></div>
    <div class="shadow_f_c"></div>
  </div>
</div>